// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: "2024-11-01",
  devtools: { enabled: true },
  runtimeConfig: {
    public: {
      BASE_URL_ENV: "/api",
      BASE_URL_PROD: "/api"
    }
  },
  modules: ["@nuxt/eslint", "@pinia/nuxt", "@element-plus/nuxt", "@nuxtjs/i18n", "@nuxt/image"],
  css: ["~/assets/scss/main.scss"],
  app: {
    head: {
      title: "App",
      htmlAttrs: {
        lang: "en"
      },
      link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
    }
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: '@use "~/assets/scss/_colors.scss" as *;'
        }
      }
    }
  },
  i18n: {
    defaultLocale: "en",
    locales: [
      { code: "en", name: "English", file: "en.json" },
      { code: "zh-CN", name: "Chinese", file: "zh-CN.json" }
    ],
    bundle: {
      optimizeTranslationDirective: false
    }
  },
  nitro: {
    devProxy: {
      "/api": {
        target: "https://api.example.com",
        changeOrigin: true,
        prependPath: true
      }
    }
  }
})
